from xadmin.models import GroupPermission

def CheckPerm(perm_type, perm_slug, groupid):
    '''
    :param perm_type: 权限类型
    :param perm_slug: 权限按钮
    :param groupid:  角色id
    :return:
    '''
    perm = GroupPermission.objects.filter(group_id=groupid, permission_type=perm_type, permission_slug=perm_slug)
    if perm:
        return True
    else:
        return False